package com.raising.modules.sys.entity;


import com.raising.framework.entity.BaseEntity;
import org.springframework.format.annotation.DateTimeFormat;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
* 消息发送表
* @author gaoy
* @version 1.0
*/
public class MsgSend extends BaseEntity<MsgSend> {

    private static final long serialVersionUID = 1L;
    /**消息类型  系统通知  站内信 用户通知*/
    private String type;
    /**标题*/
    private String title;
    /**内容*/
    private String content;
    /**内容纯文本*/
    private String contentText;

    /**级别 -1低 0普通 1高*/
    private int level;
    /**发送给*/
    private String users;
    /**对象标识*/
    private String objectId;
    /**消息类别*/
    private String msgType;

    /** 创建日期 */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    protected Date createDate;

    @Override
    public Date getCreateDate() {
        return createDate;
    }

    @Override
    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public MsgSend() {
        super();
    }
    public MsgSend(String id){
        super(id);
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getTitle(){
        return title;
    }

    public void setTitle(String title){
        this.title = title;
    }

    public String getContent(){
        return content;
    }

    public void setContent(String content){
        this.content = content;
    }

    public int getLevel(){
        return level;
    }

    public void setLevel(int level){
        this.level = level;
    }

    public String getUsers() {
        return users;
    }

    public void setUsers(String users) {
        this.users = users;
    }
	public String getObjectId() {
		return objectId;
	}
	public void setObjectId(String objectId) {
		this.objectId = objectId;
	}
	public String getMsgType() {
		return msgType;
	}
	public void setMsgType(String msgType) {
		this.msgType = msgType;
	}
    public String getCreateDateStr1() {
        try {
            return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.createDate);
        }catch(Exception e){
            return null;
        }
    }
    public void setCreateDateStr1(String value) {
        try {
            this.createDate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(value);
        } catch (Exception e) {
        }
    }

    public String getContentText() {
        return contentText;
    }

    public void setContentText(String contentText) {
        this.contentText = contentText;
    }
}
